home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr11
/
powerb5.zip
/
P5MSC000.TIP
< prev
next >
Wrap
Text File
|
1993-06-01
|
2KB
|
43 lines
When you or your staff enter data into a computer, it's easy
to mistype or misread an ID or account number. Such errors
can cost your organization dearly especially if funds find
their way into (or out of) the wrong account. These two
QuickBasic/QBASIC programs help you prevent this problem by
generating and then verifying account numbers with check
digits. Besides guarding against typos, this technique can
help protect you from fraud; nine times out of ten it will
catch a fabricated ID number. MAKE_ID.BAS adds a sixth digit
to any five-digit number you give it. (It does this by
adding the first, third, and fifth digits to twice the
second and fourth digits and concatenating the least
significant digit of the sum to the original number.)
CHECK_ID.BAS tests the validity of a MAKE_ID.BAS-generated
ID number by running the first five digits through the same
formula, then comparing the result to the sixth digit of the
number being tested.
Bill Hopkins
Marble Hill, Missouri
Editor's Note: Check digits have been used for many years in
credit card numbers, supermarket bar codes, and even the
ISBN numbers found on books. If you want even greater
security, you can create ID numbers with multiple check
digits or with check characters that can take the form of
letters or digits. I've enhanced Mr. Hopkins's code, without
changing the underlying algorithm, to be more bulletproof
and to work with arrays rather than simply with character
strings. The files CHECK_ID.BAS and MAKE_ID.BAS both appear
in the P5UTL directory of your PowerBase *.* Volume 5
diskette. You can use these utilities as-is or copy the
GenID and CheckID subroutines, which generate and check the
ID numbers, into your own BASIC code.
Title: BASIC ID Number Generator
Category: MSC
Issue Date: March, 1992
Editor: Brett Glass
Supplementary Files: P5UTL\CHECK_ID.BAS, P5UTL\MAKE_ID.BAS
Filename: P5MSC000.TIP